# 基于官方Elasticsearch镜像构建
FROM elasticsearch:8.13.4

# 必须在环境变量声明后立即切换用户
USER root

# 设置时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
    echo $TZ > /etc/timezone

# 以非root用户运行
USER elasticsearch

EXPOSE 9200 9300
